<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>


<html>
<jsp:useBean id="ahora" class="java.util.Date" />     

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<link href="css/mc.css" rel="stylesheet" type="text/css">

<script type="text/javascript">
	function eliminar(strCod){
		if(confirm('¿Está seguro que desea eliminar el contribuyente seleccionado?')){
			//document.forms[0].operacion.value='eliminar';
			document.forms[0].action='contribuyente.do?operacion=eliminar&contribuyente='+strCod;
			document.forms[0].submit();
		}	
	}

</script>

</head>

<body>

	<table>
		<tr>
			<td class="control" >

				<form action="contribuyente.do" method="post">
				
		<c:if test="${requestScope.li_contribuyente!=null}">
				<table>
				  <tr class="grilla_cabecera" >
	  			    <th>  <fmt:message key="key.cod" />  </th>
				    <th>  <fmt:message key="nom" /> </th>
				    <th> <fmt:message key="apepat" /> </th>
				    <th> <fmt:message key="apemat" /> </th>
				    <th>  <fmt:message key="razsoc" /> </th>
				    <th> <fmt:message key="res" /> </th>
				    <th> <fmt:message key="sex" /> </th>
				    <th> <fmt:message key="tel" /> </th>
				    <th> <fmt:message key="email" /> </th>
				    <th> <fmt:message key="fecreg" /> </th>
				    <th> <fmt:message key="fecact" /> </th>
				    <th> <fmt:message key="tip" /> </th>
				    <th> <fmt:message key="est" /> </th>
				    <th> <fmt:message key="eli" /> </th>
				    <th> <fmt:message key="mod" /> </th>
				  </tr>

					<c:forEach var="cont"  
							items="${requestScope.li_contribuyente}" >
						
						  <tr class="grilla_campo" >
						  	<td>  ${cont.codigo } </td>
						    <td>  ${cont.nombre }  </td>
						    <td>  ${cont.apePat } </td>
						    <td>  ${cont.apeMat } </td>
						    <td>  ${cont.razsoc }  </td>
						    <td>  ${cont.lugRes } </td>
						    <td>  ${cont.sexo } </td>
						    <td>  ${cont.telefono } </td>
						    <td>  ${cont.email } </td>
						    <td>  ${cont.fecReg } </td>
						    <td>  ${cont.fecAct } </td>
						    <td>  ${cont.tipo } </td>
						    <td>  ${cont.estado } </td>
						    <td align="center" > 
						    
						    	<a  href="javascript:eliminar('${cont.codigo}')" >E</a>  	
						    
						    </td>
						    <td align="center" > 
						    	 <a  href="contribuyente.do?operacion=cargaModifica&contribuyente=${cont.codigo}" >M</a>  
						    </td>
						   
						  </tr>
					
					</c:forEach>
					
					
					<tr  class="control" >
						<td colspan="5" align="right"  >
							<a href="CUR01 2 IngresarContribuyente.jsp" > 
								Registrar Contribuyente	   
							</a>
							&nbsp;
							<a href="javascript:f_elimina()" > 
								   
							</a>
						</td>
					
					</tr>
					
				
				
					
				<tr>
					<td colspan="5" ></td>
				</tr>					
				<tr>
					<td colspan="5" ></td>
				</tr>					
				<tr>
					<td class="control"  colspan="2">
						<fmt:formatDate 
								dateStyle="full"
								type="date"
								value="${ahora}"   />
					
					</td>

					<td class="control"  colspan="2">

					</td>
				</tr>				
				  
				</table>
			
				</c:if>
							
				</form>

			</td>
			
			
		</tr>
		
	</table>

</body>

</html>